;
(function($){
	$.extend({
		tcMask:function(options){
			var defaults={
				zz:'<div class="mask" style="display: none;position: absolute;top: 0%;left: 0%;width: 100%;height: 100%;background-color: black;z-index:1001;-moz-opacity: 0.8;opacity:0.8;filter: alpha(opacity=80);"></div>',
				url:"",
				params:"",
				tc:'<div class="tanchu" style="display: block;z-index:1002;position: absolute;"></div>'
			};
			var options=$.extend(defaults,options);
			var iDocuH=$(document).height();
			var iDocuW=$(document).width();
			var isIE6=$.browser.msie&&$.browser.version==6.0;
			if($(".mask").size()>=1){
				$(".mask").show();
			}else{
				$("body").append(options.zz);
				$(".mask").css({"width":iDocuW+"px","height":iDocuH+"px","display":"block"});
			}
			if($(".tanchu").size()>=1){
				$(".tanchu").remove();
			}else{
				$("body").append(options.tc);
			}
			var iTcW;
			var iTcH;
			var iWinW;
			var iWinH;
			var tcTop;
			var tcLeft;
			$(".tanchu").load(options.url,options.params,function(){
				 iTcW=$(".tanchu").width();
				 iTcH=$(".tanchu").height();
				 iWinW=$(window).width();
				 iWinH=$(window).height();
				 tcTop=(iWinH-iTcH)/2;
				 tcLeft=(iWinW-iTcW)/2;
				 if(isIE6){
						$(".tanchu").css({"display":"block","position":"absolute","left":tcLeft+"px","top":tcTop+"px"});
						$(window).scroll(function(){
							$(".tanchu").css({"display":"block","position":"absolute","left":tcLeft+"px","top":tcTop+$(window).scrollTop()+"px"});
						});
					}else{
						$(".tanchu").css({"display":"block","position":"fixed","left":tcLeft+"px","top":tcTop+"px"});	
					}
			});
			
			/*$(".tc_wrap .btn_close").live("click",function(){
				$(".tanchu").hide().remove();
				$(".mask").hide();							
			});*/
		}
	});	  
})(jQuery);
